﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class msg : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        buildcode();
    }
    //生成验证码
    public void buildcode()
    {
        Random a = new Random();
        code.Text = "";
        string temp = "";
        for (int i = 0; i < 4; i++)
        {
            string t = Convert.ToInt16(9 * a.NextDouble()).ToString();
            code.Text += "<img height='20' src='img/count/" + t + ".gif'>";
            temp += t;
        }
        Session.Add("safecode", temp);
    }
}
